const Mock = require('mockjs')

const data = Mock.mock({
  'routes': [{
    path: '/page2',
    component: 'Layout',
    redirect: '/page2-1',
    meta: {
      title: 'Dashboard',
      icon: 'lock'
    },
    children: [{
        path: 'page2-1',
        name: 'page2-1',
        component: '@/views/page/page2-1.vue',
        meta: {
          title: 'page2-1',
          icon: 'dashboard'
        }
      },
      {
        path: 'page2-2',
        name: 'page2-2',
        component: '@/views/page/page2-2.vue',
        meta: {
          title: 'page2-2',
          icon: 'dashboard'
        }
      }
    ]
  }]
})

module.exports = [{
  url: '/vue-admin-template/api/profile',
  type: 'get',
  response: config => {
    const routes = data.routes
    return {
      code: 20000,
      data: {
        routes
      }
    }
  }
}]
